package com.ruoyi.web.controller.teacher;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.domain.BaseSrequipmentInfo;
import com.ruoyi.service.IBaseSrequipmentInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 收发设备Controller
 * 
 * @author ruoyi
 * @date 2025-07-04
 */
@RestController
@RequestMapping("/teacher/info")
public class BaseSrequipmentInfoController extends BaseController
{
    @Autowired
    private IBaseSrequipmentInfoService baseSrequipmentInfoService;

    /**
     * 查询收发设备列表
     */
    @GetMapping("/list")
    public TableDataInfo list(BaseSrequipmentInfo baseSrequipmentInfo)
    {
        startPage();
        List<BaseSrequipmentInfo> list = baseSrequipmentInfoService.selectBaseSrequipmentInfoList(baseSrequipmentInfo);
        return getDataTable(list);
    }

    /**
     * 获取收发设备详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(baseSrequipmentInfoService.selectBaseSrequipmentInfoById(id));
    }

    /**
     * 新增收发设备
     */
    @Log(title = "收发设备", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody BaseSrequipmentInfo baseSrequipmentInfo)
    {
        return toAjax(baseSrequipmentInfoService.insertBaseSrequipmentInfo(baseSrequipmentInfo));
    }

    /**
     * 修改收发设备
     */
    @Log(title = "收发设备", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody BaseSrequipmentInfo baseSrequipmentInfo)
    {
        return toAjax(baseSrequipmentInfoService.updateBaseSrequipmentInfo(baseSrequipmentInfo));
    }

    /**
     * 删除收发设备
     */
    @Log(title = "收发设备", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(baseSrequipmentInfoService.deleteBaseSrequipmentInfoByIds(ids));
    }
}
